logo

SEA Shark and Ray Research and Conservation Workshop


Introductions

Who am I?

Vinay is a Research Scientist at the Australian Institute of Marine Science. He is an ecologist that is particularly interested in using spatio-temporal datasets to understand animal movements and distributions patterns. He has considerable experience using R to analyse and visualise large and complex spatial datasets. He has developed R code and packages to analyse 2 and 3 dimensional movement patterns of animals using acoustic telemetry data from single study sites to continental scale arrays. Vinay’s R codes can be found on his github page.


Course outline

In this course you will learn about different ways to analyse and interpret your aquatic telemetry datasets using R. This workshop will demonstrate how R can make the processing of spatial data much quicker and easier than using standard GIS software! At the end of this workshop you will also have the annotated R code that you can re-run at any time, share with collaborators and build on with those newly acquired data!

I designed this course not to comprehensively cover all the tools in R, but rather to give you an understanding of options on how to analyse your telemetry data (both from satellite and acoustic tags). Every new project comes with its own problems and questions and you will need to be independent, patient and creative to solve these challenges. It makes sense to invest time in becoming familiar with R, because today R is the leading platform for environmental data analysis and has some other functionalities which may surprise you!


This R workshop is intended to run across 3 sessions.


  • Session 1: Getting familiar with R and spatial data
  1. A brief introduction to R
  2. Import and explore datasets using %pipes% and the tidyverse group of R packages
  3. Working with Spatial objects using the sf R package
  4. Generating interactive maps using mapview


  • Session 2: Working with satellite telemetry data
  1. Understanding the data structure from satellite tags
  2. Processing satellite tag data using the aniMotum package
  3. Visualising satellite tag data using the ggspatial package


  • Session 3: Working with passive acoustic telemetry data
  1. Understanding the data structure from acoustic telemetry data
  2. Using the VTrack R package to explore patterns in animal detections and dispersal
  3. Using the remora R package to interactively explore your telemetry data



The main principles we hope you will learn today are…

  • Data wrangling in R is safe, fast, reliable and repeatable
  • R can easily handle large datasets
  • R is the ideal suite for performing your GIS operations
  • that in R, it is easy to produce amazing publication-ready images



Course Resources

The course resources will be emailed to you prior to the workshop. However, you can also access the data and scripts we will work through in this course, download the course resources from this GitHub repository page. This page contains the course documents, telemetry example data and R scripts we are going to work with. To download the folder click on the green Code, dropdown menu and select “Download ZIP”






Session 1

Getting familiar with R and spatial data



1.1 A brief Introduction to R

The process of turning raw telemetry data into publishable results is a highly involved. Tracking data sets are becoming larger, and larger as they are being gathered over longer time periods, over larger spatial extents and at increasing temporal resolutions. While this is increasing our ability to detect subtle patterns, these data sets are becoming vast and require analytical tools that easily handle, manipulate and visualise these complex datasets.

Processing and analysing telemetry datasets can require a huge investment in time: rearranging data, removing erroneous values, purchasing, downloading and learning the new software, and running analyses. Furthermore merging together Excel spreadsheets, filtering data and preparing data for statistical analyses and plotting in different software packages can introduce all sorts of errors.

There is a better way…

R is a powerful language for data wrangling and analysis because…

  1. It is relatively fast to run and process commands
  2. You can create repeatable scripts
  3. You can trace errors back to their source
  4. You can share your scripts with other people
  5. It is easy to identify errors in large data sets
  6. Having your data in R opens up a huge array of cutting edge analysis tools.
  7. R is also totally FREE!

As R is open source, the more people we can get helping out on the R mailing lists (e.g. R-sig-geo) and contributing their own packages to the wider community, the more powerful R becomes!

For this course, we assume you have a basic understanding of the R environment, and working with RStudio








Session 2

Working with satellite telemetry data


2.1. Analysing bull shark movements in an estuarine system


2.1.1. Filtering detections with actel


2.1.2. Refining in-water paths with RSP


2.1.3. dynamic Brownian Bridge Movement Models (dBBMM)


2.2. Analysing bull shark movements along the coast


2.2.1. Analysing bull shark movements along the coast






Session 3

Working with passive acoustic telemetry data

In this session we will go through a brief walk through of how we can use the VTrack R package to quickly format and analyse large acoustic tracking datasets. A lot of the functions here do similar analyses to the ones you learned in the previous session. We will then go through a new R package called remora that helps users to interactively explore thier data as well as append environmental data to detections to further your analysis of animal movements.

Here we are just arming you with multiple tools to be able to analyse your data. Which analysis (and thus R package) is more appropriate and suitable to your dataset will depend on your study design, research questions and data available. For this session, we will use the same data you worked on in session 2, however we will use the IMOS Workshop_Bull-shark-sample-dataset in the data folder you have downloaded.



3.1 Using the VTrack R package to explore patterns in animal detections and dispersal

The VTrack package can be downloaded from GitHub. As we only have a short time for this session, I will only go over this briefly. If you want to have a more comprehensive walk through of VTrack, go through the examples on this page.

## Install packages
install.packages("remotes")
remotes::install_github("rossdwyer/VTrack")


If you R asks you if you would like to update packages, select No. This seems to be an issue with some people attempting to install packages from Github. You can update other packages separately if you feel that you need to, however doing it while installing a package from GitHub often stalls the whole process.

## Load other useful packages
library(VTrack)
library(tidyverse)
library(lubridate)
library(sf)
library(mapview)


3.1.1 Input, explore and format data from IMOS repository to use in VTrack


3.1.2 Examine patterns in detection and dispersal





3.2 Using the remora R package to interactivley explore your telemetry data


3.2.1 Undertaking Quality control checks on your raw detection data


3.2.2 Extracting and appending environmental variables to acoustic telemetry data








Signoff!

This is where we end our R workshop! There may have been a few bits of code that you had trouble with or need more time to work through. We encourage you to discuss these with us as well as others at the workshop to help get a handle on the R code.


If you have any comments or queries reguarding this workshop feel free to contact me:

Happy Tracking!